#!/bin/bash
system_info=$(uname -a)
install_termux_dir="/data/data/com.termux/files/usr/bin"
install_debian_dir="/usr/bin"
function pkg_install {
	pkg install $1 -y
	return $?
}
function apt_install {
	apt install $1 -y
	return $?
}
function check_install {
	if ! ls $1 | grep -qw "$2";
	then
		$3
	fi
}
function judgment {
	if echo "$system_info" | grep -q "Android";
	then
		check_install "$install_termux_dir" $1 $2
		return $?
	else
		check_install "$install_debian_dir" $1 $3
		return $?
	fi
}
function judgment_main {
	if [[ $? -eq 0 ]]; then
		main
	else
		echo "$1安装错误，请重试！"
		exit 1
	fi
}
